package text111;

import java.util.Arrays;
import java.util.LinkedList;

public class Solution35 {
	static int A = 1;
	static int J = 11;
	static int Q = 12;
	static int K = 13;
    public boolean isStraight(int[] nums) {
    	
    	LinkedList< Integer> aList = new LinkedList<Integer>();
    	//给随机数组排序
    	Arrays.sort(nums);
    	//剔除大小王0，其余的放入新数组
    	for (int i = 0; i < nums.length; i++) {
			if (nums[i]!=0) {
				aList.add(nums[i]);
			}
		}
    	//判断数组中除了0之外是否有重复的数，如果有返回false
        for (int i = 0; i <aList.size()-1; i++) {
			if (aList.get(i)==aList.get(i+1)) {
				return false;
			}
		}
        int s = aList.size();
        for (int i = 0; i < aList.size(); i++) {
			System.out.println(aList.get(i));
		}
        //判断是否是顺子，（数组中最大最小数的差值是否超过4）
    	int t = nums[4]-aList.get(0);
    	if (t<=4) {
			return true;
		}
		return false;
	
    }
}
